<template>
	<navBar title="权限设置"></navBar>
	<view>
		<u-cell title="通知权限" isLink arrow :border-bottom="true" :title-color="themeColors.textColor"
			@click="getReminderPermission"></u-cell>
		<u-cell title="位置权限" isLink arrow :border-bottom="true" :title-color="themeColors.textColor"
			@click="getLocationPermission"></u-cell>
		<u-cell title="后台位置权限" isLink arrow :border-bottom="true" :title-color="themeColors.textColor"
			@click="getBackgroundPermission"></u-cell>
		<u-cell title="权限管理" isLink arrow :border-bottom="true" :title-color="themeColors.textColor"
			@click="openSetting"></u-cell>
	</view>
	<tabBar></tabBar>
</template>

<script>
	import {
		requestReminderPermission,
		requestLocationPermission,
		requestBackgroundPermission
	}
	from '@/utils/permission';
	import {
		themeColor
	}
	from '@/stores/themeColor'
	export default {
		data() {
			return {

			};
		},

		computed: {
			// 当前主题颜色
			themeColors() {
				return themeColor().themes[themeColor().currentThemeIndex]
			}
		},

		methods: {
			getReminderPermission() {
				requestReminderPermission()
			},

			getLocationPermission() {
				requestLocationPermission()
			},
			
			getBackgroundPermission() {
				requestBackgroundPermission()
			},

			openSetting() {
				uni.openSetting()
			}
		}
	}
</script>

<style lang="scss">

</style>